package validator;

public class PersonRelationValidator {
	
	private Integer person = null, relation = null, enterprise = null; 
	
	public PersonRelationValidator(String person, String relation, String enterprise) {
		try{
			this.person = Integer.parseInt(person);
		} catch(NullPointerException | NumberFormatException e){ }		
		try{
			this.relation = Integer.parseInt(relation);
		} catch(NullPointerException | NumberFormatException e){ }
		try{
			this.enterprise = Integer.parseInt(enterprise);
		} catch(NullPointerException | NumberFormatException e){ }
	}
	
	public boolean isValid(){
		return person != null && relation != null && enterprise != null;
	}

	public Integer getPerson() {
		return person;
	}

	public Integer getRelation() {
		return relation;
	}
	
	public Integer getEnterprise() {
		return enterprise;
	}
	
}
